ghacks-clear-57-[changes-only].js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* see https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.6-Bulk-Pref-Resetting-[Scratchpad] */
  2. (function() {
  3. let ops = [
  4. '_user.js.parrot',
  5. /* --- 57-alpha --- */
  6. /* commented out */
  7. 'browser.storageManager.enabled',
  8. 'dom.storageManager.enabled',
  9. /* removed from the user.js */
  10. 'browser.search.geoip.timeout',
  11. 'geo.wifi.xhr.timeout',
  12. 'gfx.layerscope.enabled',
  13. 'media.webspeech.recognition.enable',
  14. /* moved to RFP ALTERNATIVES */
  15. 'dom.w3c_touch_events.enabled',
  16. 'media.video_stats.enabled',
  17. /* moved to DEPRECATED/REMOVED */
  18. 'browser.bookmarks.showRecentlyBookmarked',
  19. 'browser.casting.enabled',
  20. 'devtools.webide.autoinstallFxdtAdapters',
  21. 'media.eme.chromium-api.enabled',
  22. 'social.directories',
  23. 'social.enabled',
  24. 'social.remote-install.enabled',
  25. 'social.share.activationPanelEnabled',
  26. 'social.shareDirectory',
  27. 'social.toast-notifications.enabled',
  28. 'social.whitelist'
  29. ]
  30. if("undefined" === typeof(Services)) {
  31. alert("about:config needs to be the active tab!");
  32. return;
  33. }
  34. let c = 0;
  35. for (let i = 0, len = ops.length; i < len; i++) {
  36. if (Services.prefs.prefHasUserValue(ops[i])) {
  37. Services.prefs.clearUserPref(ops[i]);
  38. if (!Services.prefs.prefHasUserValue(ops[i])) {
  39. console.log("reset", ops[i]);
  40. c++;
  41. } else { console.log("failed to reset", ops[i]); }
  42. }
  43. }
  44. focus();
  45. let d = (c==1) ? " pref" : " prefs";
  46. if (c > 0) {
  47. alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)");
  48. } else { alert("nothing to reset"); }
  49. })();